/*
 * Copyright (c) 2018-2999 湖南洛云网络科技有限公司 All rights reserved.
 *
 * https://www.gz-yami.com/
 *
 * 未经允许，不可做商业用途！
 *
 * 版权所有，侵权必究！
 */

package com.yami.shop.delivery.api.controller;


import com.yami.shop.bean.app.dto.MyOrderDto;
import com.yami.shop.delivery.comment.model.OrderSelfStation;
import com.yami.shop.delivery.comment.service.OrderSelfStationService;
import com.yami.shop.security.api.util.SecurityUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author Lanhai
 */
@RestController
@RequestMapping("/p/orderSelfStation")
@Api(tags = "用户自提订单信息接口")
@AllArgsConstructor
public class OrderSelfStationController {


    private final OrderSelfStationService orderSelfStationService;

    /**
     * 获取常用提货人信息
     */
    @GetMapping("/getStationUserInfo")
    @ApiOperation(value = "获取常用提货人信息", notes = "用户创建订单时，获取常用提货人信息")
    public ResponseEntity<List<OrderSelfStation>> getStationUserInfo() {
        String userId = SecurityUtils.getUser().getUserId();
        List<OrderSelfStation> orderSelfStationList = orderSelfStationService.getStationUserInfo(userId);
        return ResponseEntity.ok(orderSelfStationList);
    }

}
